<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>区域设置</title>
	<!-- 导入jquery核心类库 -->
	<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"
			th:src="@{//localhost:8082/assert/js/jquery-1.8.3.js}"></script>
	<!-- 导入easyui类库 -->
	<link id="easyuiTheme" rel="stylesheet" type="text/css"
		  href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css"
		  th:href="@{//localhost:8082/assert/js/easyui/themes/default/easyui.css}">
	<link rel="stylesheet" type="text/css"
		  href="${pageContext.request.contextPath }/js/easyui/themes/icon.css"
		  th:href="@{//localhost:8082/assert/js/easyui/themes/icon.css}">
	<link rel="stylesheet" type="text/css"
		  href="${pageContext.request.contextPath }/css/default.css"
		  th:href="@{//localhost:8082/assert/css/default.css}">
	<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"
			th:src="@{//localhost:8082/assert/js/easyui/jquery.easyui.min.js}"></script>
	<!-- 导入ztree类库 -->
	<link rel="stylesheet"
		  href="${pageContext.request.contextPath }/js/ztree/zTreeStyle.css"
		  type="text/css" th:href="@{//localhost:8082/assert/js/ztree/zTreeStyle.css}"/>
	<script
			src="${pageContext.request.contextPath }/js/ztree/jquery.ztree.all-3.5.js"
			type="text/javascript" th:src="@{//localhost:8082/assert/js/ztree/jquery.ztree.all-3.5.js}"></script>
	<script
			src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"
			type="text/javascript" th:src="@{//localhost:8082/assert/js/easyui/locale/easyui-lang-zh_CN.js}"></script>
	<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript">
	function doAdd() {
		$('#addRegionWindow').window("open");
	}

	function doView() {
		alert("修改...");
	}

	function doDelete() {
		alert("删除...");
	}

	//工具栏
	var toolbar = [];
	// 定义列
	var columns = [ [ {
		field : 'sid',
		title : '学号',
		width : 200,
		align : 'center'
	}, {
		field : 'sname',
		title : '姓名',
		width : 200,
		align : 'center'
	}, {
		field : 'classname',
		title : '班级',
		width : 200,
		align : 'center',
		formatter : function(data, row, index) {
			return row.classes.classname;
		}
	}, {
		field : 'sex',
		title : '性别',
		width : 200,
		align : 'center'
	}, {
		field : 'password',
		title : '密码',
		width : 200,
		align : 'center'
	}, {
		field : 'qx',
		title : '权限',
		width : 200,
		align : 'center'
	} ] ];

	$(function() {
		// 先将body隐藏，再显示，不会出现页面刷新效果
		$("body").css({
			visibility : "visible"
		});

		// 收派标准数据表格
		$('#grid')
				.datagrid(
						{
							iconCls : 'icon-forward',
							fit : true,
							border : false,
							rownumbers : true,
							striped : true,
							pageList : [ 30, 50, 100 ],
							pagination : true,
							toolbar : toolbar,
							url : "${pageContext.request.contextPath}/student/findStudentByclass.action",
							idField : 'id',
							columns : columns,
							onDblClickRow : doDblClickRow
						});

		// 添加、修改区域窗口
		$('#addRegionWindow').window({
			title : '添加修改区域',
			width : 400,
			modal : true,
			shadow : true,
			closed : true,
			height : 400,
			resizable : false
		});

	});

	function doDblClickRow() {
		alert("双击表格数据...");
	}
</script>
<script type="text/javascript">
	$(function() {
		$("#button-import")
				.upload(
						{
							action : '${pageContext.request.contextPath}/student/importXls.action',
							name : 'myFile',
							onComplete : function(data) {
								if (data == '1') {
									//上传成功
									$.messager.alert("提示信息", "区域数据导入成功！",
											"info");
								} else {
									//失败
									$.messager.alert("提示信息", "区域数据导入失败！",
											"warning");
								}
							}
						});
	});
</script>
</head>
<body class="easyui-layout" style="visibility: hidden;">
	<div region="center" border="false">
		<table id="grid"></table>
	</div>
</body>
</html>